home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
extras
/
programm
/
gemfsc19
/
gemfsc19.lzh
/
INCLUDE
/
GEMFINTL.H
< prev
Wrap
C/C++ Source or Header
|
1993-05-11
|
6KB
|
154 lines
/**************************************************************************
* GEMFINTL.H - Stuff internal to the GemFast implementation.
*************************************************************************/
#ifndef GEMFINTL_H
#define GEMFINTL_H
#include "gemfast.h"
#include <string.h>
#include <stdio.h>
/*----------------------------------------------------------------------------
* some macros used to declare static functions in library internals.
*--------------------------------------------------------------------------*/
#define INTERNAL_VFUNC static void GNEAR GREGARGS
#define INTERNAL_IFUNC static int GNEAR GREGARGS
/*----------------------------------------------------------------------------
* mundane macros.
*--------------------------------------------------------------------------*/
#ifndef NULL
#define NULL ((void *)0)
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
/*----------------------------------------------------------------------------
* handy function-like macros.
*--------------------------------------------------------------------------*/
#define Array_els(a) ( sizeof(a) / sizeof((a)[0]) )
/*----------------------------------------------------------------------------
* Macros to get the 'real' value of object fields.
* Extended objects have the ob_type and ob_spec moved out of the object
* and into the XUSERBLK. Library internals sometimes need the actual
* object's ob_type or ob_spec, however (to determine whether to go after
* the XUSERBLK values, for example), so these macros access the values
* in the object itself.
*
* OBXTYPE - the value of the extended object type
* OBGTYPE - the value of the basic (GEM) object type
* OBVSPEC - the value of the ob_spec
* OBPSPEC - a pointer to the ob_spec
* XUBPTR - a pointer to the XUSERBLK or NULL if not an extended obj
*--------------------------------------------------------------------------*/
#define OBXTYPE(pobj) ( ((unsigned char *)&((pobj)->ob_type))[0] )
#define OBGTYPE(pobj) ( ((unsigned char *)&((pobj)->ob_type))[1] )
#define OBVSPEC(pobj) ( ((pobj)->ob_flags & INDIRECT) ? \
*(_Ob_spec_t*)(pobj)->_Ob_spec : (pobj)->_Ob_spec )
#define OBPSPEC(pobj) ( ((pobj)->ob_flags & INDIRECT) ? \
(_Ob_spec_t*)(pobj)->_Ob_spec : &((pobj)->_Ob_spec) )
#define XUBPTR(pobj) ( (OBGTYPE(pobj) == G_USERDEF) ? _GetXub(pobj) : NULL )
/*-------------------------------------------------------------------------
* All dynamic dialogs get these options.
*-----------------------------------------------------------------------*/
#define FRM_DEFAULT_DYNOPT (FRM_USEBLIT | FRM_MOVEABLE | FRM_MOUSEARROW)
#define FRM_MANDATORY_DYNOPT (FRM_CENTER | FRM_DCOMPLETE)
/*-------------------------------------------------------------------------
* FormControl structure used by frm_dialog internals.
*-----------------------------------------------------------------------*/
typedef struct form_control {
OBJECT *ptree;
void *blitbuffer;
short (*form_do) __PROTO((struct form_control *ctl));
long options;
short editobj;
short parentobj;
short moverobj;
short defaultobj;
short specialobj;
short select_state;
short treeflags;
GRECT littlerect;
GRECT scrnrect;
GRECT *pboundrect;
} FormControl;
/*-------------------------------------------------------------------------
* protos.
*-----------------------------------------------------------------------*/
extern long _FrmDefaults;
extern void (*_AesVCleanup) __PROTO((void));
extern void * apl_malloc __PROTO((unsigned long amount));
extern void apl_free __PROTO((void *block));
extern void _ApXinit __PROTO((void));
extern FormControl * _FrmSetup __PROTO((FormControl *ctl, long options, OBJECT *ptree, GRECT *pboundrect));
extern void frm_cleanup __PROTO((FormControl *ctl));
extern FormControl * frm_init __PROTO((long options, OBJECT *ptree, GRECT *pboundrect));
extern void frm_start __PROTO((FormControl *ctl));
extern void frm_draw __PROTO((FormControl *ctl, short obj));
extern void frm_finish __PROTO((FormControl *ctl));
extern void frm_move __PROTO((FormControl *ctl));
extern short frm_do __PROTO((FormControl *ctl, short editobj));
extern short frm_mdo __PROTO((FormControl *ctl));
extern void * frm_dovector __PROTO((void *newfunc));
extern char * _FrmVFormat __PROTO((char *fmt, va_list args, short *plen));
extern void _FrmVFree __PROTO((char *buffer));
extern void _FrmTrWidths __PROTO((OBJECT *tree, short parent, short width));
extern short _FrmDS2Obj __PROTO((char **ppstr, OBJECT *pobj, TEDINFO *pted, short *pwidth, short maxobjs));
extern void _FrmNLPatch __PROTO((char **patch_array));
extern void _FrmNL2DS __PROTO((char *strings, char **ptr_array, char **patch_array, short maxstrings));
extern void * _GetXub __PROTO((OBJECT *pobj));
extern short obj__draw __PROTO((OBJECT *tree, short obj, short depth, GRECT *cliprect));
/*----------------------------------------------------------------------------
* Define mnemonics for internal error codes.
* Note that we set the base to the bottom of our staked-out range, and
* let the enum increment upwards from there. Our staked-out range is
* currently -15199 thru -15100.
*--------------------------------------------------------------------------*/
#define GEMFAST_ERRNO_BASE (-15199)
enum {
gfErr_no_memory = GEMFAST_ERRNO_BASE,
gfErr_vdi_handle,
gfErr_parameter_range,
gfErr_parameter_null,
gfErr_resource_in_use,
gfErr_wrong_type,
gfErr_option_invalid,
gfErr_action_invalid,
gfErr_object_too_small,
gfErr_object_too_big,
gfSuccess = 0
};
#endif /* GEMFINTL_H */